/*gcc -c -o gtkLayout.o gtkLayout.c `pkg-config --cflags --libs gtk+-2.0`*/
#include "mygtk.h"
#include <gtk/gtk.h>

Container_t *getGridContainer(Widget_t* root, int mode)
{
	GtkWidget *container;
	if (mode)
		container = gtk_hbox_new(FALSE, 0);
	else
		container = gtk_vbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(root), container);
	return container;
}

Container_t *getAbsoluteContainer(Widget_t* root)
{
	GtkWidget *container;
	container = gtk_fixed_new();
	gtk_container_add(GTK_CONTAINER(root), container);
	return container;
}

void grid(Container_t* container, Widget_t* item)
{
	gtk_container_add(GTK_CONTAINER(container), item);
	gtk_widget_show(item);
}

void pack(Container_t* container, Widget_t* item, int pos[4])
{
	gtk_fixed_put(GTK_FIXED(container), item, pos[0], pos[1]);
	gtk_widget_set_size_request(item, pos[2], pos[3]);
}

Container_t *getContainerOfButton(Widget_t* root, int mode)
{
	GtkWidget *container;
	if (mode)
		container = gtk_hbutton_box_new();
	else
		container = gtk_vbutton_box_new();
	gtk_container_add(GTK_CONTAINER(root), container);
	return container;
}